package com.xbk.seckill.activity.application.dubbo;

import com.xbk.seckill.activity.application.service.SeckillActivityService;
import com.xbk.seckill.common.model.dto.SeckillActivityDTO;
import com.xbk.seckill.dubbo.interfaces.activity.SeckillActivityDubboService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author xiexu
 * @version 1.0.0
 * @description Dubbo服务
 */
@Component
// 暴露Dubbo服务
@DubboService(version = "1.0.0")
public class SeckillActivityDubboServiceImpl implements SeckillActivityDubboService {

    /**
     * 秒杀活动服务
     */
    @Autowired
    private SeckillActivityService seckillActivityService;

    /**
     * 获取活动信息
     * 
     * @param id      活动id
     * @param version 版本号
     * @return 活动信息
     */
    @Override
    public SeckillActivityDTO getSeckillActivity(Long id, Long version) {
        return seckillActivityService.getSeckillActivity(id, version);
    }
}
